home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / e / Chris_emods.lha / Chris_emods.readme next >
Text File  |  1997-08-24  |  6KB  |  195 lines

  1. Short:    5 emods. Progress window, scrolling, lists, exec lists, screens
  2. Uploader: chris@planb.TheGAP.com (Chris Perver)
  3. Author:   chris@planb.TheGAP.com (Chris Perver)
  4. Type:     dev/e
  5. Replaces: dev/e/Chris_emods.lha
  6.  
  7. Here is the first of my slightly useful AmigaE modules.
  8.  
  9. --------------------------------------------------------------------------------
  10.  
  11. myscrollraster()  works  exactly  like  ScrollRaster().  myscrollraster()   uses
  12. BlitCopy(),  and  doesn't clear the new area of raster, which is useful for when
  13. you want to have clean looking scrolling. I use it for EvenMore.
  14.  
  15.   myscrollraster(rp, x, y, x2, y2, deltax, deltay)
  16.  
  17.   EXAMPLE
  18.  
  19.     myscrollraster(rp, 5, 5, 50, 50, -10, 20)
  20.  
  21.   INPUT
  22.  
  23.     rp     - Rastport
  24.     x      - Left coord
  25.     y      - Top coord
  26.     x2     - Right coord
  27.     y2     - Bottom coord
  28.     deltax - How many pixels to scroll horizontally
  29.     deltay - How many pixels to scroll vertically
  30.  
  31.   BUGS
  32.  
  33.     Don't think it can handle scrolls larger than the area to scroll. But
  34.     because this function doesn't clear the new area of raster, there wouldn't
  35.     be any visual difference anyway.
  36.  
  37.  
  38. --------------------------------------------------------------------------------
  39.  
  40.  
  41. The next two functions are useful for preference files,  etc.  I  use  them  for
  42. EvenMore :). insertinlist() will take a string of numbers, seperated by slashes,
  43. and insert each value into the list. Will stop inserting values when it comes to
  44. the end of the list.
  45.  
  46.   insertinlist(list, str)
  47.  
  48.   EXAMPLE
  49.  
  50.     insertinlist(list, '5/40/6/3')
  51.  
  52.   INPUT
  53.  
  54.     list   - A list (Not exec list), list := [0,0,0,0]
  55.  
  56.  
  57. mergelist2str() does the opposite of insertinlist(). mergelist2str() will take a
  58. list, and return the string of the values in that list, seperated by slashes.
  59.  
  60.   string := mergelist2str(list)
  61.  
  62.   EXAMPLE
  63.  
  64.     str := mergelist2str(list)
  65.  
  66.   INPUT
  67.  
  68.     list   - A list (Not exec list), list := [0,0,0,0]
  69.  
  70.   OUTPUT
  71.  
  72.     string - A string of values seperated by slashes, '0/54/334/23'
  73.  
  74.  
  75. --------------------------------------------------------------------------------
  76.  
  77.  
  78. The functions in execlists.m are useful for manuplating exec lists.
  79.  
  80.  
  81.   addName(list, str) - Add a list node to a list
  82.  
  83.   freeNode(list, num) - Free node number <num> form a list
  84.  
  85.   freeNameNodes(list) - Free all nodes in the list
  86.  
  87.   num := findNodeNumber(list, str) - Find the position of the node <str> in the
  88.                                      list
  89.  
  90.   str := findNodeName(list, num) - Find the name of node <num> in the list
  91.  
  92.   movelistnode(list1, pos1, list2, pos2) - Move a node from one list/position to
  93.                                            another
  94.  
  95.   EXAMPLE
  96.  
  97.     movelistnode(list, 3, list 4)
  98.     movelistnode(list, 3, anotherlist, 6)
  99.  
  100.   INPUT
  101.  
  102.     list1 - An exec list
  103.     pos1  - The number of the node to move
  104.     list2 - An exec list. Can be the same list as list1
  105.     pos2  - The position to put the new node in list2
  106.  
  107.   num := countnodes(list) - Returns number of nodes in a list
  108.  
  109.  
  110. --------------------------------------------------------------------------------
  111.  
  112.  
  113. findpubscreen() in the screens.m module will return  TRUE  if  a  public  screen
  114. named <str> exists.
  115.  
  116.   findpubscreen(str)
  117.  
  118.   EXAMPLE
  119.  
  120.    bool := findpubscreen('Workbench')
  121.  
  122.   INPUT
  123.  
  124.     str - Name of a public screen
  125.  
  126.   OUTPUT
  127.  
  128.     bool - True if a public screen is open that matches the name str.
  129.  
  130. --------------------------------------------------------------------------------
  131.  
  132.  
  133. The progresswin module will allow you to display a window with a progress bar in
  134. it. I use this module for EvenMore, when loading files.
  135.  
  136. First, put this module into your source.
  137.  
  138.   MODULE '*progresswin'
  139.  
  140. Then you need to make a DEF.
  141.  
  142.   DEF pw:PTR TO progresswin
  143.  
  144. At the start of your program, put..
  145.  
  146.   NEW pw
  147.  
  148. And at the end of your program, put..
  149.  
  150.   END pw
  151.  
  152. When you want to open the progress window, just type the following...
  153.  
  154.   openprogresswin(pw, screenname, winptr, str)
  155.  
  156.   screenname - Name of public screen to open on. Can be NIL.
  157.   winptr     - The pointer to your window to centre the progress window on.
  158.                IF NIL, the progress window will centre on the screen.
  159.   str        - A string to display above the progress gadget
  160.  
  161. To update the progress gadget, just type the following...
  162.  
  163.   drawprogressgad(pw, percentage)
  164.  
  165.   percentage - Percentage for progress gadget to be filled
  166.  
  167. To close the progress window, just type the following...
  168.  
  169.   closeprogresswin(pw)
  170.  
  171. The progress window will use the screen font of the screen it opens on  for  the
  172. text. A few values are hard-coded, but you could easily change that if you want.
  173. The window will be 6 times the screen font height high, and 250 pixels wide. The
  174. text  will appear 1/3rd of the way down the window, and the progress gadget will
  175. appear in the middle of the window.
  176.  
  177. If you want to use the window more than once without closing  it,  for  example,
  178. for  copying  a  batch  of files, just call the drawprogresstext() function. The
  179. text will be redrawn.
  180.  
  181.   drawprogresstext(pw, 'Progressing :)')
  182.  
  183. Exceptions   Exception info  Description
  184.  
  185.   "PUBS"     screenname      Unable to lock pubscreen
  186.   "DRI"                      Unable to get screen drawinfo
  187.   "VIS"                      Unable to get visualinfo
  188.   "FONT"                     Unable to open screen font
  189.   "WIN"                      Unable to open window
  190.   "SCRL"                     Unable to lock pubscreen list
  191.  
  192. ================================================================================
  193.  
  194. You are free to use these PROCs for whatever you wish.
  195.